package com.example.batbat.view;

import android.app.Application;
import android.util.Log;

import com.alibaba.android.arouter.launcher.ARouter;
import com.example.common.user.GlobalUser;

import java.io.FileNotFoundException;


public class BatBatApplication extends Application {
    private boolean isDebugARouter=true;
    private static final String TAG="BatBatApplication";

    @Override
    public void onCreate() {
        super.onCreate();

        if(isDebugARouter){
            ARouter.openLog();
            ARouter.openDebug();
        }

        ARouter.init(this);
        Log.i(TAG, "onCreate: ARouter创建了！");

        //初始化token
        try {
            GlobalUser globalUser=GlobalUser.getInstance();
            globalUser.setToken(getApplicationContext());
            Log.i(TAG, "onCreate: token"+GlobalUser.TOKEN);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

    }
}
